/*
 * Atomic.h
 *
 *  Created on: 2011-7-26
 *      Author: gexiao
 */

#ifndef ATOMIC_H_
#define ATOMIC_H_
#include <stdint.h>
/*
 *
 */
#define ATOMIC_CMP_SWAP(_addr, _old, _new) \
            (android_atomic_cmpxchg((_old), (_new), (_addr)) == 0)

int android_atomic_cmpxchg(int32_t old, int32_t new, volatile int32_t* addr);
#endif /* ATOMIC_H_ */
